package com.wn32.main.demo6;

public class Main1 {
    public static void main(String[] args) {
        MyThread th1=new MyThread();
        th1.start();
        //Thread始终比main线程慢,Thread线程有一个 就绪 => 运行 的过程
        System.out.println(Thread.currentThread().getName()+":蜗牛学院");
    }
}
class MyThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i <10 ; i++) {
            System.out.println(Thread.currentThread().getName()+":"+i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
